using System;

namespace Acme.BookStore.Purchase.Customergoods
{
    public static class CustomergoodsCacheOptions
    {
        /// <summary>
        /// 列表查询缓存时间（分钟）
        /// </summary>
        public const int ListCacheDuration = 10;

        /// <summary>
        /// 条件查询缓存时间（分钟）
        /// </summary>
        public const int ConditionsCacheDuration = 5;

        /// <summary>
        /// 获取缓存选项
        /// </summary>
        public static Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions GetDefaultOptions(int minutes = ListCacheDuration)
        {
            return new Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(minutes)
            };
        }
    }
} 